package com.assignwork.service.impl;

import com.assignwork.vo.ThroughputForecastOreVO;
import com.assignwork.vo.ThroughputForecastVO;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springblade.core.mp.base.BaseServiceImpl;
import com.assignwork.entity.ThroughputForecastOre;
import com.assignwork.mapper.ThroughputForecastOreMapper;
import com.assignwork.service.IThroughputForecastOreService;

import java.util.Collections;
import java.util.List;

/**
 * (ThroughputForecastOre)表服务实现类
 */
@AllArgsConstructor 
@Service("throughputForecastOreService")
public class ThroughputForecastOreServiceImpl extends BaseServiceImpl<ThroughputForecastOreMapper, ThroughputForecastOre> implements IThroughputForecastOreService {

    @Override
    public List<ThroughputForecastOreVO> listVO(String year) {
        List<ThroughputForecastOre> list = this.lambdaQuery()
                .eq(ThroughputForecastOre::getYear, year)
                .last("order by month::numeric")
                .list();
        return ThroughputForecastOreVO.fromEtt(list);
    }

}
